/* 
 * File:   LedsHandler.h
 * Author: Arno
 *
 * Created on 15 juni 2012, 13:04
 */

#ifndef LEDSHANDLER_H
#define	LEDSHANDLER_H
#include "pRTOS.h"
#include "resources.h"
#include "Leds.h"

class LedsHandler : public RTOS::task {
    
public:
    LedsHandler() : blinkDurTimer( this ), blinkFreqTimer( this ), ledFlag( this ){}
    void blink(int dur, int freq);
    void setLives( int lives );
    
private:
     LedState state;
     Leds Led;
     RTOS::timer blinkDurTimer, blinkFreqTimer;
     RTOS::flag ledFlag;
     struct ledData{ int duration; int frequency; }; 
     RTOS::pool < struct ledData > ledPool;
     RTOS::pool < unsigned int > livesPool;
     ledData temp, current;
     int duration, frequency, currLives;
     bool ledsOn;
     void main(void);
};

#endif	/* LEDSHANDLER_H */

